/**
 * 
 */
package com.gome.axwl.aoc.service.feign;


import java.util.List;
import java.util.Map;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.anxl.sso.client.api.Account;
import com.anxl.sso.client.api.AccountInfo;
import com.github.pagehelper.PageInfo;
import com.gome.axwl.aoc.common.constants.FeignServiceName;
import com.gome.axwl.aoc.common.constants.MasterDataReqMapConstant;
import com.gome.axwl.aoc.entity.driver.CarrierFromMasterDto;
import com.gome.axwl.aoc.entity.driver.DriverAccount;
import com.gome.axwl.aoc.entity.driver.DriverWithCarrierDto;
import com.gome.axwl.aoc.service.feign.fallback.MasterDataFeignFallBack;
import com.gome.commons.core.ResultData;

/**   
*    
* 项目名称：gome.axwl.op.service
* 类名称：MasterDataFeignClient
* 类描述：   
* 创建人：chengh
* 创建时间：2018年4月25日10:07:42
* @version        
*/
@FeignClient(value = FeignServiceName.GATE_WAY+FeignServiceName.MDM, fallback = MasterDataFeignFallBack.class)
//@FeignClient(name = "mdm", url = "10.122.1.165:8081", fallback = MasterDataFeignFallBack.class)
public interface MasterDataFeignClient {


	/**获取服务商信息 只有 carrierId,carrierNo,carrierName
	 *
	 * @param keyword
	 * @return
	 */
    @RequestMapping(method = RequestMethod.GET, value =MasterDataReqMapConstant.QueryCarrierByKeyword)
    ResultData<List<CarrierFromMasterDto>> QueryCarrierByKeyword(@RequestParam("keyword") String keyword, @RequestParam("dcId")String dcId);

	/**
	 *获取司机信息
	 * @param keyword
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value =MasterDataReqMapConstant.QueryDriverByKeyword)
	ResultData QueryDriverByKeyword(@RequestParam("keyword") String keyword,@RequestParam("dcId")String dcId);

	/**
	 *获取用户的DC编码
	 * @param accountNo
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value =MasterDataReqMapConstant.getDcCodeByAccountNo)
	ResultData getDcCodeByAccountNo(@RequestParam("accountNo") String accountNo);

	/**
	 *查询DC信息集合
	 * @param list
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value =MasterDataReqMapConstant.getDcByDcCodes)
	ResultData<Map<String,Object>> getDcByDcCodes(@RequestParam("dcNos") List<String> list);

	/**
	 *查询DC下的用户
	 * @param dcNos
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET, value =MasterDataReqMapConstant.getDriversByDcCodes)
	ResultData<List<DriverAccount>> getDriversByDcCodes(@RequestParam("dcNos") List<String> dcNos);


	/**
	 * 根据司机编码查询详情，带服务商信息
	 * @param driverNo
	 * @return
	 */
	@RequestMapping(value = MasterDataReqMapConstant.queryDriverDetail,method = RequestMethod.GET)
	ResultData<DriverWithCarrierDto> queryDriverDetail(@RequestParam("driverNo")String driverNo);

	/**
	 * 查询司机列表
	 * @param driverId
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@RequestMapping(value = MasterDataReqMapConstant.queryDriver,method = RequestMethod.GET)
	ResultData<PageInfo<DriverWithCarrierDto>> queryDriver(@RequestParam("driverId") Integer driverId,@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize")Integer pageSize);

	/**
	 * 根据服务商编码查询司机列表
	 * @param driverNo
	 * @param driverName
	 * @param carrierNo
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@RequestMapping(value = MasterDataReqMapConstant.screenDriver,method = RequestMethod.GET)
	ResultData<PageInfo<DriverWithCarrierDto>> screenDriver(@RequestParam("driverNo") String driverNo, @RequestParam("driverName") String driverName,@RequestParam("carrierNo") String carrierNo, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize")Integer pageSize);

	/**
	 * 根据用户ID编码查询用户详情
	 * @param accountNo
	 * @return
	 */
	@RequestMapping(value = MasterDataReqMapConstant.getByAccountNo,method = RequestMethod.GET)
	ResultData<AccountInfo> getUserByAccountNo(@RequestParam("accountNo") String accountNo);


	/**
	 * 根据邀请码编码查询用户详情(批量)
	 * @param inviteCodes
	 * @return
	 */
	@RequestMapping(value = MasterDataReqMapConstant.getAccountListByInviteCodes,method = RequestMethod.GET)
	ResultData<List<AccountInfo>> getAccountListByInviteCodes(@RequestParam("inviteCodes") List<String> inviteCodes);


    @RequestMapping(value = MasterDataReqMapConstant.queryByKeyword,method = RequestMethod.GET)
    ResultData<List<Account>> queryAccountByKeyword(@RequestParam("keyWord") String keyword);


	@RequestMapping(value = MasterDataReqMapConstant.getAccountListByKeyword,method = RequestMethod.GET)
	ResultData<List<Account>> queryInviteCode(@RequestParam("keyWord") String keyword);


}
